<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FabGL: VGA/ModelineStudio/ModelineStudio.ino</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">FabGL
   </div>
   <div id="projectbrief">ESP32 Display Controller and Graphics Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('_v_g_a_2_modeline_studio_2_modeline_studio_8ino-example.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">VGA/ModelineStudio/ModelineStudio.ino</div>  </div>
</div><!--header-->
<div class="contents">
<p>Test VGA output at predefined resolutions or custom resolution by specifying linux-like modelines</p>
<div class="fragment"><div class="line"><span class="comment">/*</span></div><div class="line"><span class="comment">  Created by Fabrizio Di Vittorio (fdivitto2013@gmail.com) - www.fabgl.com</span></div><div class="line"><span class="comment">  Copyright (c) 2019-2020 Fabrizio Di Vittorio.</span></div><div class="line"><span class="comment">  All rights reserved.</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">  This file is part of FabGL Library.</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">  FabGL is free software: you can redistribute it and/or modify</span></div><div class="line"><span class="comment">  it under the terms of the GNU General Public License as published by</span></div><div class="line"><span class="comment">  the Free Software Foundation, either version 3 of the License, or</span></div><div class="line"><span class="comment">  (at your option) any later version.</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">  FabGL is distributed in the hope that it will be useful,</span></div><div class="line"><span class="comment">  but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><span class="comment">  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div><div class="line"><span class="comment">  GNU General Public License for more details.</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">  You should have received a copy of the GNU General Public License</span></div><div class="line"><span class="comment">  along with FabGL.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div><div class="line"><span class="comment"> */</span></div><div class="line"></div><div class="line"></div><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="fabgl_8h.html">fabgl.h</a>&quot;</span></div><div class="line"></div><div class="line"></div><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span> * PresetResolutions[] = {</div><div class="line">  VGA_256x384_60Hz,</div><div class="line">  VGA_320x200_75Hz,</div><div class="line">  VGA_320x200_75HzRetro,</div><div class="line">  QVGA_320x240_60Hz,</div><div class="line">  VGA_400x300_60Hz,</div><div class="line">  VGA_480x300_75Hz,</div><div class="line">  VGA_512x192_60Hz,</div><div class="line">  VGA_512x384_60Hz,</div><div class="line">  VGA_512x448_60Hz,</div><div class="line">  VGA_512x512_58Hz,</div><div class="line">  VGA_640x200_70Hz,</div><div class="line">  VGA_640x200_70HzRetro,</div><div class="line">  VGA_640x240_60Hz,</div><div class="line">  VGA_640x350_70Hz,</div><div class="line">  VGA_640x350_70HzAlt1,</div><div class="line">  VESA_640x350_85Hz,</div><div class="line">  VGA_640x382_60Hz,</div><div class="line">  VGA_640x384_60Hz,</div><div class="line">  VGA_640x400_70Hz,</div><div class="line">  VGA_640x400_60Hz,</div><div class="line">  VGA_640x480_60Hz,</div><div class="line">  VGA_640x480_60HzAlt1,</div><div class="line">  VGA_640x480_60HzD,</div><div class="line">  VGA_640x480_73Hz,</div><div class="line">  VESA_640x480_75Hz,</div><div class="line">  VESA_720x400_85Hz,</div><div class="line">  PAL_720x576_50Hz,</div><div class="line">  VESA_768x576_60Hz,</div><div class="line">  SVGA_800x300_60Hz,</div><div class="line">  SVGA_800x600_56Hz,</div><div class="line">  SVGA_800x600_60Hz,</div><div class="line">  SVGA_960x540_60Hz,</div><div class="line">  SVGA_1024x768_60Hz,</div><div class="line">  SVGA_1024x768_70Hz,</div><div class="line">  SVGA_1024x768_75Hz,</div><div class="line">  SVGA_1280x600_60Hz,</div><div class="line">  SVGA_1280x720_60Hz,</div><div class="line">  SVGA_1280x720_60HzAlt1,</div><div class="line">  SVGA_1280x768_50Hz,</div><div class="line">};</div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> currentResolution = 24;  <span class="comment">// VESA_640x480_75Hz</span></div><div class="line"><span class="keywordtype">int</span> moveX = 0;</div><div class="line"><span class="keywordtype">int</span> moveY = 0;</div><div class="line"><span class="keywordtype">int</span> shrinkX = 0;</div><div class="line"><span class="keywordtype">int</span> shrinkY = 0;</div><div class="line"></div><div class="line"></div><div class="line"><a name="_a0"></a><a class="code" href="classfabgl_1_1_v_g_a2_controller.html">fabgl::VGA2Controller</a> VGAController;</div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> printHelp()</div><div class="line">{</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;Modeline studio\n&quot;</span>);</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;Chip Revision: %d   Chip Frequency: %d MHz\n\n&quot;</span>, ESP.getChipRevision(), ESP.getCpuFreqMHz());</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;%s\n&quot;</span>, VGAController.getResolutionTimings()-&gt;label);</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;\nScreen move:\n&quot;</span>);</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;  w = Move Up   z = Move Down   a = Move Left   s = Move Right\n&quot;</span>);</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;Screen shrink:\n&quot;</span>);</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;  n = Dec Horiz N = Inc Horiz   m = Dec Vert    M = Inc Vert\n&quot;</span>);</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;Resolutions:\n&quot;</span>);</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;  + = Next resolution  - = Prev resolution   x = Restore modeline\n&quot;</span>);</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;Modeline change:\n&quot;</span>);</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;  ! = Insert modline. Example: !\&quot;640x350@70Hz\&quot; 25.175 640 656 752 800 350 366 462 510 -HSync -VSync\n&quot;</span>);</div><div class="line">  <span class="comment">/*</span></div><div class="line"><span class="comment">  Serial.printf(&quot;  e = Decrease horiz. Front Porch   E = Increase horiz. Front Porch\n&quot;);</span></div><div class="line"><span class="comment">  Serial.printf(&quot;  r = Decrease horiz. Sync Pulse    R = Increase horiz. Sync Pulse\n&quot;);</span></div><div class="line"><span class="comment">  Serial.printf(&quot;  t = Decrease horiz. Bach Porch    T = Increase horiz. Back Porch\n&quot;);</span></div><div class="line"><span class="comment">  Serial.printf(&quot;  y = Decrease vert. Front Porch    Y = Increase vert. Front Porch\n&quot;);</span></div><div class="line"><span class="comment">  Serial.printf(&quot;  u = Decrease vert. Sync Pulse     U = Increase vert. Sync Pulse\n&quot;);</span></div><div class="line"><span class="comment">  Serial.printf(&quot;  i = Decrease vert. Bach Porch     I = Increase vert. Back Porch\n&quot;);</span></div><div class="line"><span class="comment">  */</span></div><div class="line">  Serial.printf(<span class="stringliteral">&quot;  o = Decrease frequency by 5KHz    O = Increase frequency by 5KHz\n&quot;</span>);</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;  . = Change horiz. signals order\n&quot;</span>);</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;Various:\n&quot;</span>);</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;  h = Print This help\n\n&quot;</span>);</div><div class="line">}</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> printInfo()</div><div class="line">{</div><div class="line">  <span class="keyword">auto</span> t = VGAController.getResolutionTimings();</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;Modeline \&quot;%s\&quot; %2.8g %d %d %d %d %d %d %d %d %cHSync %cVSync %s %s\n&quot;</span>,</div><div class="line">                t-&gt;label,</div><div class="line">                t-&gt;frequency / 1000000.0,</div><div class="line">                t-&gt;HVisibleArea,</div><div class="line">                t-&gt;HVisibleArea + t-&gt;HFrontPorch,</div><div class="line">                t-&gt;HVisibleArea + t-&gt;HFrontPorch + t-&gt;HSyncPulse,</div><div class="line">                t-&gt;HVisibleArea + t-&gt;HFrontPorch + t-&gt;HSyncPulse + t-&gt;HBackPorch,</div><div class="line">                t-&gt;VVisibleArea,</div><div class="line">                t-&gt;VVisibleArea + t-&gt;VFrontPorch,</div><div class="line">                t-&gt;VVisibleArea + t-&gt;VFrontPorch + t-&gt;VSyncPulse,</div><div class="line">                t-&gt;VVisibleArea + t-&gt;VFrontPorch + t-&gt;VSyncPulse + t-&gt;VBackPorch,</div><div class="line">                t-&gt;HSyncLogic, t-&gt;VSyncLogic,</div><div class="line">                t-&gt;scanCount == 2 ? <span class="stringliteral">&quot;DoubleScan&quot;</span> : <span class="stringliteral">&quot;&quot;</span>,</div><div class="line">                t-&gt;HStartingBlock == <a name="a1"></a><a class="code" href="group___enumerations_gac2082e5f1e16f3780b8e7d796ea10632.html#ggac2082e5f1e16f3780b8e7d796ea10632a3fe66d1dbf572a4f40096a3780f5f5cd">VGAScanStart::FrontPorch</a> ? <span class="stringliteral">&quot;FrontPorchBegins&quot;</span> :</div><div class="line">                (t-&gt;HStartingBlock == <a name="a2"></a><a class="code" href="group___enumerations_gac2082e5f1e16f3780b8e7d796ea10632.html#ggac2082e5f1e16f3780b8e7d796ea10632aa1c3e25967ce8edc4bf943ae05fa7af9">VGAScanStart::Sync</a> ? <span class="stringliteral">&quot;SyncBegins&quot;</span> :</div><div class="line">                (t-&gt;HStartingBlock == <a name="a3"></a><a class="code" href="group___enumerations_gac2082e5f1e16f3780b8e7d796ea10632.html#ggac2082e5f1e16f3780b8e7d796ea10632ad5f83b0219ea6b63db4fedab582a2da5">VGAScanStart::BackPorch</a> ? <span class="stringliteral">&quot;BackPorchBegins&quot;</span> : <span class="stringliteral">&quot;VisibleBegins&quot;</span>)));</div><div class="line"></div><div class="line">  <span class="comment">//Serial.printf(&quot;VFront = %d, VSync = %d, VBack = %d\n&quot;, t-&gt;VFrontPorch, t-&gt;VSyncPulse, t-&gt;VBackPorch);</span></div><div class="line"></div><div class="line">  <span class="keywordflow">if</span> (moveX || moveY)</div><div class="line">    Serial.printf(<span class="stringliteral">&quot;moveScreen(%d, %d)\n&quot;</span>, moveX, moveY);</div><div class="line">  <span class="keywordflow">if</span> (shrinkX || shrinkY)</div><div class="line">    Serial.printf(<span class="stringliteral">&quot;shrinkScreen(%d, %d)\n&quot;</span>, shrinkX, shrinkY);</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;Screen size   : %d x %d\n&quot;</span>, VGAController.<a name="a4"></a><a class="code" href="classfabgl_1_1_base_display_controller_a749df909b39fd096bf6e2813f2f5324c.html#a749df909b39fd096bf6e2813f2f5324c">getScreenWidth</a>(), VGAController.<a name="a5"></a><a class="code" href="classfabgl_1_1_base_display_controller_a0872427e4a351bb3590e8d00096e9cba.html#a0872427e4a351bb3590e8d00096e9cba">getScreenHeight</a>());</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;Viewport size : %d x %d\n&quot;</span>, VGAController.getViewPortWidth(), VGAController.getViewPortHeight());</div><div class="line">  Serial.printf(<span class="stringliteral">&quot;Free memory (total, min, largest): %d, %d, %d\n\n&quot;</span>, heap_caps_get_free_size(MALLOC_CAP_32BIT),</div><div class="line">                                                                   heap_caps_get_minimum_free_size(MALLOC_CAP_32BIT),</div><div class="line">                                                                   heap_caps_get_largest_free_block(MALLOC_CAP_32BIT));</div><div class="line">}</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> updateScreen()</div><div class="line">{</div><div class="line">  Canvas cv(&amp;VGAController);</div><div class="line">  cv.setPenColor(<a name="a6"></a><a class="code" href="group___enumerations_gab87bacfdad76e61b9412d7124be44c1c.html#ggab87bacfdad76e61b9412d7124be44c1cab548046646b36c12aa6ba841de500094">Color::White</a>);</div><div class="line">  cv.setBrushColor(<a name="a7"></a><a class="code" href="group___enumerations_gab87bacfdad76e61b9412d7124be44c1c.html#ggab87bacfdad76e61b9412d7124be44c1cac1e9bce8242f443c54c7405223d616cd">Color::Black</a>);</div><div class="line">  cv.clear();</div><div class="line">  cv.fillRectangle(0, 0, cv.getWidth() - 1, cv.getHeight() - 1);</div><div class="line">  cv.drawRectangle(0, 0, cv.getWidth() - 1, cv.getHeight() - 1);</div><div class="line"></div><div class="line">  cv.selectFont(&amp;fabgl::FONT_8x8);</div><div class="line">  cv.setGlyphOptions(GlyphOptions().<a name="a8"></a><a class="code" href="displaycontroller_8h_a4054936031229707e9189e4f2c865e67.html#a4054936031229707e9189e4f2c865e67">FillBackground</a>(<span class="keyword">true</span>).<a name="a9"></a><a class="code" href="displaycontroller_8h_aceea3df50e577272aa576027eede649d.html#aceea3df50e577272aa576027eede649d">DoubleWidth</a>(1));</div><div class="line">  cv.drawText(40, 20, VGAController.getResolutionTimings()-&gt;label);</div><div class="line"></div><div class="line">  cv.setGlyphOptions(GlyphOptions());</div><div class="line">  cv.drawTextFmt(40, 40, <span class="stringliteral">&quot;Screen Size   : %d x %d&quot;</span>, VGAController.<a class="code" href="classfabgl_1_1_base_display_controller_a749df909b39fd096bf6e2813f2f5324c.html#a749df909b39fd096bf6e2813f2f5324c">getScreenWidth</a>(), VGAController.<a class="code" href="classfabgl_1_1_base_display_controller_a0872427e4a351bb3590e8d00096e9cba.html#a0872427e4a351bb3590e8d00096e9cba">getScreenHeight</a>());</div><div class="line">  cv.drawTextFmt(40, 60, <span class="stringliteral">&quot;Viewport Size : %d x %d&quot;</span>, cv.getWidth(), cv.getHeight());</div><div class="line">  cv.drawText(40, 80,    <span class="stringliteral">&quot;Commands (More on UART):&quot;</span>);</div><div class="line">  cv.drawText(40, 100,   <span class="stringliteral">&quot;  w = Move Up    z = Move Down&quot;</span>);</div><div class="line">  cv.drawText(40, 120,   <span class="stringliteral">&quot;  a = Move Left  s = Move Right&quot;</span>);</div><div class="line">  cv.drawText(40, 140,   <span class="stringliteral">&quot;  + = Next Resolution&quot;</span>);</div><div class="line">  cv.drawRectangle(35, 15, 310, 155);</div><div class="line">}</div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> setup()</div><div class="line">{</div><div class="line">  Serial.begin(115200);</div><div class="line"></div><div class="line">  <span class="comment">// avoid garbage into the UART</span></div><div class="line">  delay(500);</div><div class="line"></div><div class="line">  VGAController.begin();</div><div class="line">  VGAController.<a name="a10"></a>setResolution(PresetResolutions[currentResolution]);</div><div class="line">  updateScreen();</div><div class="line">  printHelp();</div><div class="line">  printInfo();</div><div class="line">}</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> loop()</div><div class="line">{</div><div class="line">  <a name="_a11"></a><a class="code" href="structfabgl_1_1_v_g_a_timings.html">fabgl::VGATimings</a> t;</div><div class="line"></div><div class="line">  <span class="keywordflow">if</span> (Serial.available() &gt; 0) {</div><div class="line">    <span class="keywordtype">char</span> c = Serial.read();</div><div class="line">    <span class="keywordflow">switch</span> (c) {</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;h&#39;</span>:</div><div class="line">        printHelp();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;w&#39;</span>:</div><div class="line">        --moveY;</div><div class="line">        VGAController.moveScreen(0, -1);</div><div class="line">        printInfo();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;z&#39;</span>:</div><div class="line">        ++moveY;</div><div class="line">        VGAController.moveScreen(0, +1);</div><div class="line">        printInfo();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;a&#39;</span>:</div><div class="line">        --moveX;</div><div class="line">        VGAController.moveScreen(-1, 0);</div><div class="line">        printInfo();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;s&#39;</span>:</div><div class="line">        ++moveX;</div><div class="line">        VGAController.moveScreen(+1, 0);</div><div class="line">        printInfo();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;x&#39;</span>:</div><div class="line">        moveX = moveY = shrinkX = shrinkY = 0;</div><div class="line">        VGAController.setResolution(PresetResolutions[currentResolution]);</div><div class="line">        updateScreen();</div><div class="line">        printInfo();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;+&#39;</span>:</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;-&#39;</span>:</div><div class="line">        moveX = moveY = shrinkX = shrinkY = 0;</div><div class="line">        currentResolution = (c == <span class="charliteral">&#39;+&#39;</span> ? currentResolution + 1 : currentResolution - 1);</div><div class="line">        <span class="keywordflow">if</span> (currentResolution == <span class="keyword">sizeof</span>(PresetResolutions) / <span class="keyword">sizeof</span>(<span class="keyword">const</span> <span class="keywordtype">char</span> *))</div><div class="line">          currentResolution = 0;</div><div class="line">        <span class="keywordflow">if</span> (currentResolution &lt; 0)</div><div class="line">          currentResolution = <span class="keyword">sizeof</span>(PresetResolutions) / <span class="keyword">sizeof</span>(<span class="keyword">const</span> <span class="keywordtype">char</span> *) - 1;</div><div class="line">        VGAController.setResolution(PresetResolutions[currentResolution]);</div><div class="line">        updateScreen();</div><div class="line">        printInfo();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;!&#39;</span>:</div><div class="line">        moveX = moveY = shrinkX = shrinkY = 0;</div><div class="line">        VGAController.setResolution( Serial.readStringUntil(<span class="charliteral">&#39;\n&#39;</span>).c_str() );</div><div class="line">        updateScreen();</div><div class="line">        printInfo();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      <span class="comment">/*</span></div><div class="line"><span class="comment">      case &#39;e&#39;:</span></div><div class="line"><span class="comment">      case &#39;E&#39;:</span></div><div class="line"><span class="comment">        t = *VGAController.getResolutionTimings();</span></div><div class="line"><span class="comment">        t.HFrontPorch = (c == &#39;e&#39; ? t.HFrontPorch - 1 : t.HFrontPorch + 1);</span></div><div class="line"><span class="comment">        VGAController.setResolution(t);</span></div><div class="line"><span class="comment">        updateScreen();</span></div><div class="line"><span class="comment">        printInfo();</span></div><div class="line"><span class="comment">        break;</span></div><div class="line"><span class="comment">      case &#39;r&#39;:</span></div><div class="line"><span class="comment">      case &#39;R&#39;:</span></div><div class="line"><span class="comment">        t = *VGAController.getResolutionTimings();</span></div><div class="line"><span class="comment">        t.HSyncPulse = (c == &#39;r&#39; ? t.HSyncPulse - 1 : t.HSyncPulse + 1);</span></div><div class="line"><span class="comment">        VGAController.setResolution(t);</span></div><div class="line"><span class="comment">        updateScreen();</span></div><div class="line"><span class="comment">        printInfo();</span></div><div class="line"><span class="comment">        break;</span></div><div class="line"><span class="comment">      case &#39;t&#39;:</span></div><div class="line"><span class="comment">      case &#39;T&#39;:</span></div><div class="line"><span class="comment">        t = *VGAController.getResolutionTimings();</span></div><div class="line"><span class="comment">        t.HBackPorch = (c == &#39;t&#39; ? t.HBackPorch - 1 : t.HBackPorch + 1);</span></div><div class="line"><span class="comment">        VGAController.setResolution(t);</span></div><div class="line"><span class="comment">        updateScreen();</span></div><div class="line"><span class="comment">        printInfo();</span></div><div class="line"><span class="comment">        break;</span></div><div class="line"><span class="comment">      case &#39;y&#39;:</span></div><div class="line"><span class="comment">      case &#39;Y&#39;:</span></div><div class="line"><span class="comment">        t = *VGAController.getResolutionTimings();</span></div><div class="line"><span class="comment">        t.VFrontPorch = (c == &#39;y&#39; ? t.VFrontPorch - 1 : t.VFrontPorch + 1);</span></div><div class="line"><span class="comment">        VGAController.setResolution(t);</span></div><div class="line"><span class="comment">        updateScreen();</span></div><div class="line"><span class="comment">        printInfo();</span></div><div class="line"><span class="comment">        break;</span></div><div class="line"><span class="comment">      case &#39;u&#39;:</span></div><div class="line"><span class="comment">      case &#39;U&#39;:</span></div><div class="line"><span class="comment">        t = *VGAController.getResolutionTimings();</span></div><div class="line"><span class="comment">        t.VSyncPulse = (c == &#39;u&#39; ? t.VSyncPulse - 1 : t.VSyncPulse + 1);</span></div><div class="line"><span class="comment">        VGAController.setResolution(t);</span></div><div class="line"><span class="comment">        updateScreen();</span></div><div class="line"><span class="comment">        printInfo();</span></div><div class="line"><span class="comment">        break;</span></div><div class="line"><span class="comment">      case &#39;i&#39;:</span></div><div class="line"><span class="comment">      case &#39;I&#39;:</span></div><div class="line"><span class="comment">        t = *VGAController.getResolutionTimings();</span></div><div class="line"><span class="comment">        t.VBackPorch = (c == &#39;i&#39; ? t.VBackPorch - 1 : t.VBackPorch + 1);</span></div><div class="line"><span class="comment">        VGAController.setResolution(t);</span></div><div class="line"><span class="comment">        updateScreen();</span></div><div class="line"><span class="comment">        printInfo();</span></div><div class="line"><span class="comment">        break;</span></div><div class="line"><span class="comment">      */</span></div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;o&#39;</span>:</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;O&#39;</span>:</div><div class="line">        t = *VGAController.getResolutionTimings();</div><div class="line">        t.<a name="a12"></a><a class="code" href="structfabgl_1_1_v_g_a_timings_a0877761f00ee2460fe16820f9d52daf1.html#a0877761f00ee2460fe16820f9d52daf1">frequency</a> = (c == <span class="charliteral">&#39;o&#39;</span> ? t.<a class="code" href="structfabgl_1_1_v_g_a_timings_a0877761f00ee2460fe16820f9d52daf1.html#a0877761f00ee2460fe16820f9d52daf1">frequency</a> - 5000 : t.<a class="code" href="structfabgl_1_1_v_g_a_timings_a0877761f00ee2460fe16820f9d52daf1.html#a0877761f00ee2460fe16820f9d52daf1">frequency</a> + 5000);</div><div class="line">        VGAController.setResolution(t);</div><div class="line">        updateScreen();</div><div class="line">        printInfo();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;.&#39;</span>:</div><div class="line">        t = *VGAController.getResolutionTimings();</div><div class="line">        <span class="keywordflow">switch</span> (t.<a name="a13"></a><a class="code" href="structfabgl_1_1_v_g_a_timings_a6ad7c58abc56e7d3c9966d2c0080f286.html#a6ad7c58abc56e7d3c9966d2c0080f286">HStartingBlock</a>) {</div><div class="line">          <span class="keywordflow">case</span> <a class="code" href="group___enumerations_gac2082e5f1e16f3780b8e7d796ea10632.html#ggac2082e5f1e16f3780b8e7d796ea10632a3fe66d1dbf572a4f40096a3780f5f5cd">VGAScanStart::FrontPorch</a>:</div><div class="line">            t.<a class="code" href="structfabgl_1_1_v_g_a_timings_a6ad7c58abc56e7d3c9966d2c0080f286.html#a6ad7c58abc56e7d3c9966d2c0080f286">HStartingBlock</a> = <a class="code" href="group___enumerations_gac2082e5f1e16f3780b8e7d796ea10632.html#ggac2082e5f1e16f3780b8e7d796ea10632aa1c3e25967ce8edc4bf943ae05fa7af9">VGAScanStart::Sync</a>;</div><div class="line">            <span class="keywordflow">break</span>;</div><div class="line">          <span class="keywordflow">case</span> <a class="code" href="group___enumerations_gac2082e5f1e16f3780b8e7d796ea10632.html#ggac2082e5f1e16f3780b8e7d796ea10632aa1c3e25967ce8edc4bf943ae05fa7af9">VGAScanStart::Sync</a>:</div><div class="line">            t.<a class="code" href="structfabgl_1_1_v_g_a_timings_a6ad7c58abc56e7d3c9966d2c0080f286.html#a6ad7c58abc56e7d3c9966d2c0080f286">HStartingBlock</a> = <a class="code" href="group___enumerations_gac2082e5f1e16f3780b8e7d796ea10632.html#ggac2082e5f1e16f3780b8e7d796ea10632ad5f83b0219ea6b63db4fedab582a2da5">VGAScanStart::BackPorch</a>;</div><div class="line">            <span class="keywordflow">break</span>;</div><div class="line">          <span class="keywordflow">case</span> <a class="code" href="group___enumerations_gac2082e5f1e16f3780b8e7d796ea10632.html#ggac2082e5f1e16f3780b8e7d796ea10632ad5f83b0219ea6b63db4fedab582a2da5">VGAScanStart::BackPorch</a>:</div><div class="line">            t.<a class="code" href="structfabgl_1_1_v_g_a_timings_a6ad7c58abc56e7d3c9966d2c0080f286.html#a6ad7c58abc56e7d3c9966d2c0080f286">HStartingBlock</a> = <a name="a14"></a><a class="code" href="group___enumerations_gac2082e5f1e16f3780b8e7d796ea10632.html#ggac2082e5f1e16f3780b8e7d796ea10632ad37a59f433488f345c4201a061f088e6">VGAScanStart::VisibleArea</a>;</div><div class="line">            <span class="keywordflow">break</span>;</div><div class="line">          <span class="keywordflow">case</span> <a class="code" href="group___enumerations_gac2082e5f1e16f3780b8e7d796ea10632.html#ggac2082e5f1e16f3780b8e7d796ea10632ad37a59f433488f345c4201a061f088e6">VGAScanStart::VisibleArea</a>:</div><div class="line">            t.<a class="code" href="structfabgl_1_1_v_g_a_timings_a6ad7c58abc56e7d3c9966d2c0080f286.html#a6ad7c58abc56e7d3c9966d2c0080f286">HStartingBlock</a> = <a class="code" href="group___enumerations_gac2082e5f1e16f3780b8e7d796ea10632.html#ggac2082e5f1e16f3780b8e7d796ea10632a3fe66d1dbf572a4f40096a3780f5f5cd">VGAScanStart::FrontPorch</a>;</div><div class="line">            <span class="keywordflow">break</span>;</div><div class="line">        }</div><div class="line">        VGAController.setResolution(t);</div><div class="line">        updateScreen();</div><div class="line">        printInfo();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;n&#39;</span>:</div><div class="line">        ++shrinkX;</div><div class="line">        VGAController.shrinkScreen(+1, 0);</div><div class="line">        updateScreen();</div><div class="line">        printInfo();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;N&#39;</span>:</div><div class="line">        --shrinkX;</div><div class="line">        VGAController.shrinkScreen(-1, 0);</div><div class="line">        updateScreen();</div><div class="line">        printInfo();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;m&#39;</span>:</div><div class="line">        ++shrinkY;</div><div class="line">        VGAController.shrinkScreen(0, +1);</div><div class="line">        updateScreen();</div><div class="line">        printInfo();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      <span class="keywordflow">case</span> <span class="charliteral">&#39;M&#39;</span>:</div><div class="line">        --shrinkY;</div><div class="line">        VGAController.shrinkScreen(0, -1);</div><div class="line">        updateScreen();</div><div class="line">        printInfo();</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">    }</div><div class="line">  }</div><div class="line">}</div></div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Wed Dec 9 2020 16:48:29 for FabGL by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
